﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using PCMSofCC.BLL;

namespace PCMSofCC.Admin
{
    public partial class AccountManagement : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Users.GetAllUsers();
        }

        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "ResetPasswordCommand")
            {
                Button button = (Button)e.CommandSource;
                GridViewRow row = (GridViewRow)button.Parent.Parent;
                string userName = row.Cells[0].Text;
                string newPassword=Users.ResetPassword(userName);
                NewPassword.Visible = true;
                NewPassword.Text = "新密码为：  " + newPassword;               
            }   
        }
    }
}
